package chaoyue.study.feature.switchEnhance;

import chaoyue.study.feature.record.RecordTest1;

/**
 * switch支持record(JDK19)
 */
public class SwitchTest3 {
    public static void main(String[] args) {
        RecordTest1 r1 = new RecordTest1(1, "chaoyue");
        test(r1);
    }

    private static void test(Object o) {
//        String result = switch (o) {
//            case RecordTest1(Integer id, String name) -> {
//                System.out.println(id + "," + name);
//                yield "test1";
//            }
//            case RecordTest2(Integer id, String name) -> {
//                yield "test2";
//            }
//        };
//        System.out.println(result);
    }
}
